<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>Theron: THERON_ALIGN_MESSAGE</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Theron
   &#160;<span id="projectnumber">6.00.02</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_856524284ebe840938865dc061f982fb.html">Include</a></li><li class="navelem"><a class="el" href="dir_7c463a385af7963c97ef4a23e37c5d06.html">Theron</a></li><li class="navelem"><a class="el" href="Align_8h.html">Align.h</a></li>  </ul>
</div>
</div><!-- top -->
<div class="contents">
<table cellspacing="0" cellpadding="0" border="0">
  <tr>
   <td valign="top">
      <div class="navtab">
        <table>
          <tr><td class="navtab"><a class="qindex" href="Align_8h_af2cc57ef1afc7508e07cf25adec9bd9b.html#af2cc57ef1afc7508e07cf25adec9bd9b">THERON_ALIGN</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="Align_8h_afde36f5f326cb238a9c56c09bcc1bcab.html#afde36f5f326cb238a9c56c09bcc1bcab">THERON_ALIGN_ACTOR</a></td></tr>
          <tr><td class="navtab"><a class="qindexHL" href="Align_8h_ac85c549d2873f38d3bfa43ab7926bf45.html#ac85c549d2873f38d3bfa43ab7926bf45">THERON_ALIGN_MESSAGE</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="Align_8h_aa86be845f4b9d38ff257ea574513e814.html#aa86be845f4b9d38ff257ea574513e814">THERON_ALIGNED</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="Align_8h_ace9b78c6c93283250d6fa9b2b4f846d2.html#ace9b78c6c93283250d6fa9b2b4f846d2">THERON_ALIGNOF</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="Align_8h_a6b92e21cf2b0c773b4a052bf6607a571.html#a6b92e21cf2b0c773b4a052bf6607a571">THERON_POSTALIGN</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="Align_8h_aab2275e2ca1403d2b6ad6f4799d78638.html#aab2275e2ca1403d2b6ad6f4799d78638">THERON_PREALIGN</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="Align_8h_aa13ea2847e77501c84f513c5c02f6ddf.html#aa13ea2847e77501c84f513c5c02f6ddf">THERON_ROUNDUP</a></td></tr>
        </table>
      </div>
   </td>
   <td valign="top" class="mempage">
<a class="anchor" id="ac85c549d2873f38d3bfa43ab7926bf45"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define THERON_ALIGN_MESSAGE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">MessageType, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">alignment&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line"><span class="keyword">namespace </span>Theron                                                            \</div>
<div class="line">{                                                                           \</div>
<div class="line">namespace Detail                                                            \</div>
<div class="line">{                                                                           \</div>
<div class="line">template &lt;&gt;                                                                 \</div>
<div class="line">struct MessageAlignment&lt;MessageType&gt;                                        \</div>
<div class="line">{                                                                           \</div>
<div class="line">    static <span class="keyword">const</span> <a class="code" href="namespaceTheron_a254da7d1d07833b997828500fbf73daa.html#a254da7d1d07833b997828500fbf73daa">uint32_t</a> ALIGNMENT = (alignment);                          \</div>
<div class="line">};                                                                          \</div>
<div class="line">}                                                                           \</div>
<div class="line">}</div>
<div class="ttc" id="namespaceTheron_a254da7d1d07833b997828500fbf73daa_html_a254da7d1d07833b997828500fbf73daa"><div class="ttname"><a href="namespaceTheron_a254da7d1d07833b997828500fbf73daa.html#a254da7d1d07833b997828500fbf73daa">Theron::uint32_t</a></div><div class="ttdeci">::uint32_t uint32_t</div><div class="ttdef"><b>Definition:</b> BasicTypes.h:72</div></div>
</div><!-- fragment -->
<p>Informs <a class="el" href="namespaceTheron.html" title="Main namespace containing all public API components. ">Theron</a> of the alignment requirements of a message type. </p>
<p>Use of this macro is optional. Using it, users can notify <a class="el" href="namespaceTheron.html" title="Main namespace containing all public API components. ">Theron</a> of any specialized memory alignment requirements of their custom message classes. If the memory alignment of a message type is specified using this macro, <a class="el" href="namespaceTheron.html" title="Main namespace containing all public API components. ">Theron</a> will request correctly aligned memory when allocating instances of that message type internally (ie. when sending messages). If not, then a default alignment of four bytes will be used.</p>
<div class="fragment"><div class="line"><span class="keyword">namespace </span>MyNamespace</div>
<div class="line">{</div>
<div class="line"></div>
<div class="line"><span class="keyword">class </span>MyMessage</div>
<div class="line">{</div>
<div class="line">};</div>
<div class="line"></div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><a class="code" href="Align_8h_ac85c549d2873f38d3bfa43ab7926bf45.html#ac85c549d2873f38d3bfa43ab7926bf45">THERON_ALIGN_MESSAGE</a>(MyNamespace::MyMessage, 16);</div>
</div><!-- fragment --><p>An important limitation of the message alignment macro is that it can only be used from within the global namespace. Furthermore the full name of the message type must be given, including all namespace scoping. Unfortunately this means that it isn't generally possible to align messages immediately after their declaration, as we'd often prefer.</p>
<dl class="section note"><dt>Note</dt><dd>Specifying the alignment requirements of an actor type is not enough, by itself, to guarantee correct alignment of actor allocations. Users must also ensure that any custom allocator provided via <a class="el" href="classTheron_1_1AllocatorManager_a9ecdc8b1ae227f95a1eae7a2d399a9c0.html#a9ecdc8b1ae227f95a1eae7a2d399a9c0">Theron::AllocatorManager::SetAllocator</a> supports aligned allocations. The DefaultAllocator, used by default, does support alignment. </dd></dl>

</div>
</div>
    </td>
  </tr>
</table>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
